#!/bin/bash
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/latest/bin:/usr/java/latest/jre:/root/bin

Vip1='192.168.30.20'
zabbix_Agent=${HOSTNAME}
zababix_Server='192.168.30.17'
Sender_Key='B1_Vip_master_192.168.30.20'

#获取vip是否在master节点 
#portal_radius_vip_status=$(/sbin/ip addr | grep -c "${Vip1}")
portal_radius_vip_status=$(ip addr | grep -c "${Vip1}")

#发送到zabbix服务器端,master端若为1则正常,若为0则不正常,backup服务器则相反
zabbix_sender -s "${zabbix_Agent}" -z "${zababix_Server}" -k "${Sender_Key}" -o "${portal_radius_vip_status}"
